class User {
  final int id;
  final String username;
  final String email;
  final String? avatar;
  final String? phoneNumber;
  final String? memberLevel;

  User({
    required this.id,
    required this.username,
    required this.email,
    this.avatar,
    this.phoneNumber,
    this.memberLevel,
  });

  factory User.fromJson(Map<String, dynamic> json) => User(
    id: json['id'] as int,
    username: json['username'] as String,
    email: json['email'] as String,
    avatar: json['avatar'] as String?,
    phoneNumber: json['phoneNumber'] as String?,
    memberLevel: json['memberLevel'] as String?,
  );

  Map<String, dynamic> toJson() => {
    'id': id,
    'username': username,
    'email': email,
    'avatar': avatar,
    'phoneNumber': phoneNumber,
    'memberLevel': memberLevel,
  };
}